package com.mentaleye.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

import com.mentaleye.biz.SystemLogBiz;
import com.mentaleye.dal.model.SystemLog;
import com.mentaleye.util.CommonPage;

@Controller
@RequestMapping("/systemLogController")
public class SystemLogController {
	
	@Autowired
	private SystemLogBiz systemLogBiz;

	@RequestMapping("/toPage")
	public String toPage(){
		return "/ss/log/logList";
	}

	@RequestMapping("/toDetailPage")
	public ModelAndView toDetailPage(@RequestParam String userId,String submitDate,String tableName){
		ModelAndView view=new ModelAndView("/ss/log/logDetailList");
		view.addObject("userId", userId);
		view.addObject("submitDate", submitDate);
		view.addObject("tableName", tableName);
		return view;
	}
	
	@RequestMapping("/getList")
	@ResponseBody
	public String getList(CommonPage commonPage){
		this.systemLogBiz.getLogListUniqueByMap(commonPage);
		return commonPage.toSHowPage();
	}
	
	@RequestMapping("/getDetailList")
	@ResponseBody
	public String getDetailList(CommonPage commonPage){
		this.systemLogBiz.getLogListByMap(commonPage);
		return commonPage.toSHowPage();
	}
}
